import request from '@/utils/request'

export function attachmentList(data) {
  return request({
    url: '/wings/store-attachment/list',
    method: 'GET',
    params: data
  })
}

export function addAttachment(data) {
  return request({
    url: `/wings/store-attachment/add`,
    method: 'POST',
    data
  })
}

export function beforeUploadAttachment() {
  return request({
    url: '/wings/store-attachment/before/upload',
    method: 'get'
  })
}

//* ************************************附件分类******************************************* */

export function attachmentCategoryTree() {
  return request({
    url: '/wings/store-attachment-category/tree',
    method: 'get'
  })
}

export function addAttachmentCategory(data) {
  return request({
    url: `/wings/store-attachment-category/add`,
    method: 'POST',
    data
  })
}

export function updateAttachmentCategory(data) {
  return request({
    url: `/wings/store-attachment-category/update`,
    method: 'PUT',
    data
  })
}

export function delAttachmentCategory(id) {
  return request({
    url: `/wings/store-attachment-category/delete/${id}`,
    method: 'DELETE'
  })
}

